package com.sihan.swvp.service.jc;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.sihan.swvp.dao.jc.JcBzDao;
import com.sihan.swvp.entity.jc.JcBz;
@Service
public class JcBzService{

	@Autowired
	private JcBzDao bzDao;
	
	public Page<Map<String, Object>> getJcBz(Map<String, Object> params,Integer page,Integer limit) {
		if(page !=null && limit !=null){
			PageHelper.startPage(page, limit);
		}
		return bzDao.getJcBz(params);
	}

	public void addJcBz(JcBz bean) {
		bzDao.addJcBz(bean);
	}

	public void updateJcBz(JcBz bean) {
		bzDao.updateJcBz(bean);
	}

	public int deleteJcBz(Integer id) {
		return bzDao.deleteJcBz(id);
	}
	
	public boolean getJcBzValidate(String bzCode,String bzName,Integer id,Integer bzzyMajorId) {
		boolean isOk=false;
		Integer nubmer=bzDao.getJcBzValidate(bzCode,bzName,id,bzzyMajorId);
		if(nubmer!=0){
			isOk=true;
		}
		return isOk;
	}

	public List<Map<String, Object>> getJcBzTree(Map<String, Object> params) {
		return bzDao.getJcBzTree(params);
	}
}
